﻿<?php
include "includeFiles.php";
include "page.php";
if(empty($cateid)) $cateid=11110;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $C['Title'];?></title>
<Link href="../uploadfile/ico/<?php echo $C['ICO'];?>" rel="Shortcut Icon">
<meta name="Keywords" content="<?php echo $C['Keywords'];?>">
<meta name="description" content="<?php echo $C['Description'];?>">
<Meta name="Copyright" Content="<?php echo $C['CopyRight'];?>">
<link href="css/reset.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
<script language="javascript" src="js/jquery.js"></script>
</head>

<body>

<?php include_once('header.php');?>
<div class="main mid">
  <?php include_once('member_left.php');?>
  <div class="main_right2">
    <div class="main_nav2"><a href="index.php">首页</a> > <a href="account.php">会员中心</a> > 交易记录</div>
    <div class="main_bt2">交易记录</div>
    <div class="main_txt2">
            
        <table width="100%" border="1" cellpadding="0" cellspacing="0" >
          <tr  style="background-color:#CCCCCC; text-align:center" >
            <td width="43">ID</td>
            <td width="200">订单号</td>
            <td width="80">时间</td>
            <td width="110">状态</td>
            <td width="110">操作</td>
          </tr>
          <?php	
	    $SQL=" select * from hy_b_order where    memberID ='".$_SESSION['user_id']."'";
		$objDb->query($SQL);
		$result = $objDb->get_data();
		if($result){
		foreach($result as $key=>$value){
	 ?>
          <tr  align="center">
            <td><?=$key+1?></td>
            <td><?=$value['orderNum']?></td>
            <td><?=date("Y-m-d",$value['createdate'])?></td>
            <td><?php
						$arrOrderState=array(
						"0"=>	"未处理",
						"1"=>	"等待买家付款",
						"2"=>	"已付款",
						"3"=>	"处理中",
						"4"=>	"卖家已经发货等待买家确认",
						"5"=>	"交易成功结束",
						"6"=> 	"退票"
						 );
						 ?>
              <?php echo $arrOrderState[$value["state"]];?></td>
              <td><a href="javascript:readetail(<?=$key?>)">查看明细</a></td>
          </tr>
          <tr style="display:none" id="<?=$key?>">
          <td colspan="5">
            <table width="100%" border="1" cellpadding="0" cellspacing="0">
            <tr>
            <td bgcolor="#D4D4D4" >产品名</td>
            <td bgcolor="#D4D4D4" >所用积分</td>
            <td bgcolor="#D4D4D4">兑换数量</td>
            </tr>
			<?
			  $pname   = explode(",",$value['productName']);
			  $prices  = explode(",",$value['price']);
			  $buynums = explode(",",$value['buyNum']);
			  
			  if(is_array($pname)){
			      foreach($pname as $key=>$value){
			?>
			<tr>
            <td><?=$pname[$key];?></td><td><?=$prices[$key];?></td><td><?=$buynums[$key];?></td>
            </tr>
		    <? } }?>
			
            </table>
            </td>
          </tr>
          <? }}?>
      </table>
	  <script language="javascript">
	   function readetail(id){
	      $("#"+id).toggle();
	   }
	  </script>
      
    </div>
  </div>
</div>
<?php include_once('footer.php');?>
</body>
</html>
